import 'rxjs/add/operator/switchMap';
import { Component, OnInit, HostBinding } from '@angular/core';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import {HostService }  from './host.service';

@Component({
  templateUrl: `./host-detail.component.html`,
  styleUrls:[ './host-detail.component.css' ]
})
export class HostDetailComponent implements OnInit {

 host: any;

  constructor(
    private route: ActivatedRoute,
    private router: Router,
    private hostService: HostService
  ) {}

  ngOnInit() {
  this.getHeroe();
  }

  getHeroe() {
    let id = this.route.snapshot.paramMap.get('id');
    this.hostService.getHero(+id).subscribe(data => {
       this.host = data['results'];
      console.log(this.host,data)
    });
  }

  match(){

  }
}
